//package com.Yukiha.gachamod.gachaMenu;
//
//import com.Yukiha.gachamod.Data.GachaSavedData;
//import com.Yukiha.gachamod.Data.PlayerGachaData;
//import com.Yukiha.gachamod.gachaMenu.client.gui.GachaBookMenu;
//import com.Yukiha.gachamod.network.ClientboundSyncGachaDataPacket;
//import com.Yukiha.gachamod.network.ModNetworkHandler;
//import net.minecraft.network.chat.Component;
//import net.minecraft.server.level.ServerPlayer;
//import net.minecraft.world.SimpleMenuProvider;
//import net.minecraftforge.network.NetworkHooks;
//
//import java.util.UUID;
//
//public class GachaScreenOpener {
//
//    public static void openGachaBookFor(ServerPlayer player, UUID uuid) {
//        PlayerGachaData data = GachaSavedData.get(player.serverLevel()).getPlayerData(uuid);
//
//        // 发同步包
//        ModNetworkHandler.sendTo(player, new ClientboundSyncGachaDataPacket(data.getAllDrawnModels()));
//
//        // 打开界面
//        NetworkHooks.openScreen(player, new SimpleMenuProvider(
//                (id, inv, ply) -> new GachaBookMenu(id, inv, uuid),
//                Component.literal("抽卡图鉴")
//        ));
//    }
//}
